-- Copyright (c) Huawei Technologies Co., Ltd. 2025. All rights reserved.
--
-- this file licensed under the Mulan PSL v2.
-- You can use this software according to the terms and conditions of the Mulan PSL v2.
-- You may obtain a copy of Mulan PSL v2 at: http://license.coscl.org.cn/MulanPSL2
--
-- THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
-- PURPOSE.
-- See the Mulan PSL v2 for more details.
--
-- Author: auto generate
-- Create: 2025-11-8
-- Description: DO NOT EDIT; Code generated by "message.lua.mako"
local validate = require 'mc.validate'
local utils = require 'mc.utils'

local MMyEepromModel = {}

---@class MMyEepromModel.RefEepromTestChip
---@field RefEepromTestChip integer[]
local TRefEepromTestChip = {}
TRefEepromTestChip.__index = TRefEepromTestChip
TRefEepromTestChip.group = {}

local function TRefEepromTestChip_from_obj(obj)
    return setmetatable(obj, TRefEepromTestChip)
end

function TRefEepromTestChip.new(RefEepromTestChip)
    return TRefEepromTestChip_from_obj({RefEepromTestChip = RefEepromTestChip})
end
---@param obj MMyEepromModel.RefEepromTestChip
function TRefEepromTestChip:init_from_obj(obj)
    self.RefEepromTestChip = obj.RefEepromTestChip
end

function TRefEepromTestChip:remove_error_props(errs, obj)
    utils.remove_obj_error_property(obj, errs, TRefEepromTestChip.group)
end

TRefEepromTestChip.from_obj = TRefEepromTestChip_from_obj

TRefEepromTestChip.proto_property = {'RefEepromTestChip'}

TRefEepromTestChip.default = {{}}

TRefEepromTestChip.struct = {{name = 'RefEepromTestChip', is_array = true, struct = nil}}

function TRefEepromTestChip:validate(prefix, errs, need_convert)
    prefix = prefix or ''

    validate.OptionalArray(prefix .. 'RefEepromTestChip', self.RefEepromTestChip, 'uint8', false, errs, need_convert)

    TRefEepromTestChip:remove_error_props(errs, self)
    validate.CheckUnknowProperty(self, TRefEepromTestChip.proto_property, errs, need_convert)
    return self
end

function TRefEepromTestChip:unpack(_)
    return self.RefEepromTestChip
end

MMyEepromModel.RefEepromTestChip = TRefEepromTestChip

return MMyEepromModel
